#include <iostream>
#include <map>
#include <limits>
using namespace std;

template < class TYPE >
TYPE fibonacci( int n ) { 
    map<int,TYPE> fi;
    fi[0] = 0;
    fi[1] = 1;
    for (int i = 2; i < n; ++i) {
        if (numeric_limits<TYPE>::max() - fi[i-1] < fi[i-2]) {
            cout << "Number limit reached at the " << i << "th one." << endl;
            cout << "The max fibonacci number is " << fi[i-1] << endl;
            break;
        }
        fi[i] = fi[i-1] + fi[i-2];
    }
    return fi[n-1];
}

int main() {
    int foo;
    cout << fixed;
    while (cin >> foo)
        cout << fibonacci<double>(foo) << endl;
    return 0;
}

